<template>
	<div id="view">
		<mobile-detail v-if="showMobile"></mobile-detail>
		<pc-detail v-else></pc-detail>
	</div>
</template>

<script>
	import mobileDetail from './mobile_detail'
	import pcDetail from './pc_detail'
	export default{
		name:'detail',
		data(){
			return{
				showMobile:false,
			}
		},
		components:{
			mobileDetail,
			pcDetail
		},
		methods:{
			_isMobile() {
		        let flag = navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i)
		        if(flag && flag.length){
		        	return true;
		        }else{
		        	return false;
		        }
		    }
		},
		created(){
			this.showMobile = this._isMobile();
		},
		mounted(){
		}
	}
</script>

<style type="text/css">
</style>